package io.renren.common.constants;

import io.renren.common.constants.enums.SysConfigType;
import io.renren.modules.sys.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @Auther: miaoguoxin
 * @Date: 2019/11/17 18:52
 * @Description: db常量初始化
 */
@Component
public class DbConstInitializer implements ApplicationRunner {
    @Autowired
    private SysConfigService sysConfigService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        DbConst.OUT_REST_KEY = sysConfigService.getValue(SysConfigType.OUT_REST_KEY.getType());
    }
}
